package com.pbdevj.ssm.bean;

import javax.validation.constraints.Pattern;

public class Employee {
    private Integer empId;

    @Pattern(regexp = "(^[a-zA-Z0-9_-]{5,16}$)|(^[\u2E80-\u9FFF]{2,5})",
    		message = "雇员名字必须是6-12位字母和数字或者是2-6个中文字符")
    private String empName;

    private String gender;
    
    @Pattern(regexp = "^([a-z0-9_\\.-]+)@([\\da-z\\.-]+)\\.([a-z\\.]{2,6})$", 
    		message = "邮件格式不正确！")
    private String email;

    private Integer dId;
    
    //查询员工时同时把部门信息查出来
    private Department department;
    
    public Employee()
	{
		// TODO Auto-generated constructor stub
	}
    
    public Employee(String empName, String gender, String email, Integer dId)
   	{
   		super();
   		this.empName = empName;
   		this.gender = gender;
   		this.email = email;
   		this.dId = dId;
   	}

    public Employee(Integer empId, String empName, String gender, String email, Integer dId)
	{
		super();
		this.empId = empId;
		this.empName = empName;
		this.gender = gender;
		this.email = email;
		this.dId = dId;
	}



	public Integer getEmpId() {
        return empId;
    }

    public void setEmpId(Integer empId) {
        this.empId = empId;
    }

    public String getEmpName() {
        return empName;
    }

    public void setEmpName(String empName) {
        this.empName = empName == null ? null : empName.trim();
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender == null ? null : gender.trim();
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email == null ? null : email.trim();
    }

    public Integer getdId() {
        return dId;
    }

    public void setdId(Integer dId) {
        this.dId = dId;
    }

	public Department getDepartment()
	{
		return department;
	}

	public void setDepartment(Department department)
	{
		this.department = department;
	}
    
}